<template>
  <div>
    <div class="ledgerTitle">项目信息</div>
    <el-form ref="optForm" :model="form" label-width="90px">
      <el-row>
        <el-col :span="6">
          <el-form-item label-width="100px" label="项目编号: " prop="projectCode" >
            {{form.projectCode}}
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="100px" label="项目名称:" prop="projectName">
            {{form.projectName}}
          </el-form-item>
        </el-col>
      </el-row>
      <div class="ledgerTitle">基本信息</div>
      <el-row>
        <el-col>
          <el-form-item label-width="100px" label="查询问题:" prop="auditMatter">
            {{form.auditMatter}}
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <el-form-item label-width="100px" label="要求反馈时间:" prop="auditMatter">
            {{form.feedbackTime}}
          </el-form-item>
        </el-col>
      </el-row>
<!--      <div class="ledgerTitle">审计查询单文书</div>-->
<!--      <el-row >-->
<!--        <el-col :span="24">-->
<!--          <el-form-item label-width="110px" label="审计查询单:" prop="projectName">-->
<!--            <web-document :form-data="form" readWord="view" :pageType="'evidence'" @createWordfile="WordfileHandle" />-->
<!--          </el-form-item>-->
<!--        </el-col>-->
<!--      </el-row>-->
    </el-form>
  </div>
</template>
<script>

import {getEvidence} from "@/api/adis/execute/evidence";
import WebDocument from '@/components/form/webDocument.vue';

export default {
  name: 'AuditEngineeringEvidenceView',
  props: {
    id: {
      type: String,
      default: ''
    },
    isAudit: {
      type: Boolean,
      default: false,
    }
  },
  components: {
    WebDocument
  },
  dictTypes: ['audit_type'],
  data() {
    return {
      pointForm: {},
      form:{},
      fileList:[],
      lawList:[
        {value: 1729795756551872513,label: '偷税漏税'},
        {value: 1729795756551876777,label: '使劲罚'}],
    }
  },
  watch: {
    id: {
      handler(val) {
        if (val) {
          getEvidence(this.id).then((res) => {
            if (res.data.data !== null){
              this.form = res.data.data;
              this.fileList = this.form.attachments;
              this.fileList.forEach((item) =>{
                item.name = item.fileName;
              })
              this.$emit('data-loaded', true);
            } else {
              this.$emit('data-loaded', false);
            }
          }).catch(() => {
            this.$emit('data-loaded', false);
          });
        }
      },deep: true, immediate: true
    }
  },
  methods: {
    WordfileHandle(e) {
      this.$set(this.form, "wordFile", e.wordFile);
      this.$set(this.form, "evidenceId", e.id);
    },
  }
}
</script>
